package main

import "fmt"

func adder() func(int) int {
	sum := 0
	return func(value int) int {
		sum = sum + value
		return sum
	}
}

func oneHundredPlus() {
	adder := adder()
	for i := 0; i <= 100; i++ {
		i2 := adder(i)
		fmt.Printf("0 + 1 + 2 + ... + %d = %d \n", i, i2)
	}
}
func main() {
	oneHundredPlus()
}
